functor
import
   Tk Browser
define
   W={New Tk.toplevel tkInit() }

   V1={New Tk.variable tkInit(false)}

   C={New Tk.checkbutton tkInit(parent:W variable:V1
                                text:'Bold' anchor:w)}

   V2={New Tk.variable tkInit('Helvetica')}

   Rs={Map ['Times' 'Helvetica' 'Courier']
           fun {$ F}
              {New Tk.radiobutton tkInit(parent:W
                                         variable:V2 value:F
                                         text:F anchor:w)}
           end}

   fun {GetWeight}
      if {V1 tkReturn($)} == "1" then bold else normal end
   end

   F = {New Tk.font tkInit(size:24 
                           family: {V2 tkReturn($)}
                           weight: {GetWeight})}

   L = {New Tk.label tkInit(parent:W text:'A test text.' font:F)}

   {C tkAction(action: proc {$}
                          {F tk(configure weight:{GetWeight})}
                          {L tk(configure font:F)}
                          {Browser.browse {GetWeight}#{V1 tkReturn($)}}
                          {Browser.browse {V1 tkReturn($)}}
                       end)}

   {List.forAllInd ['Times' 'Helvetica' 'Courier']
    proc {$ I Family}
       {{Nth Rs I} tkAction(action: proc {$}
                                       {F tk(configure family:Family)}
                                       {L tk(configure font:F)}
                                    end)}
    end}

   {Tk.batch [grid(C     padx:2#m  columnspan:3)
              grid(b(Rs) padx:2#m)
              grid(L     padx:2#m  columnspan:3)]}



end
